package com.llb666.e.shop.api.dto;

import com.llb666.e.shop.domain.entity.Users;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 用户登录dto.
 *
 * @author 斌~
 * @date 2022/8/8 下午10:37
 */
@Data
@Schema(name = "用户登录对象")
public class UserLoginDto {

    @Schema(description = "用户名", name = "username", example = "json")
    private String username;

    @Schema(description = "密码", name = "password", example = "123456")
    private String password;

    @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
    public interface Converter {
        UserLoginDto.Converter INSTANCE = Mappers.getMapper(UserLoginDto.Converter.class);

        /**
         * dto2do
         *
         * @param activity dto
         * @return do
         */
        Users dto2do(UserLoginDto activity);
    }
}
